<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'One in two thousand',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/12/13.jpg" alt="A bike path behind the clinic" class="framed-centred-image" width="649" height="480"/>
<section id="fertility">
	<h2>Fertility</h2>
	<p>
		I talked with the vasectomy surgeon today.
		I stretched the truth a bit.
		I pretended to be confident in my bisexuality, though in truth, I&apos;m not even sure I <strong>*am*</strong> bisexual.
		I may only be capable of same-sex relationships.
		My questioning didn&apos;t matter though, as it was the opposite-sex relationship capability I&apos;m doubting.
		If the information didn&apos;t turn out to be what I needed it to be, whether or not I&apos;m capable of an opposite-sex relationship, opposite-sex relationships are off the table.
	</p>
	<p>
	</p>
		Sadly, the information was indeed not what I&apos;d hoped for.
		I&apos;m glad to know the truth.
		Or at least I think I know the truth.
		In any case, there&apos;s a one in one thousand chance of a vasectomy failing.
		If after three months, you get tested for azoospermia - the desired result of a vasectomy - the chances of a positive test and still accidentally making babies is one in two thousand.
		The surgeon tried to tell me that I&apos;m not a statistic though, so even with that high probability, it&apos;s not as likely as it sounds.
		Still, I don&apos;t think the surgeon grasps the consequences for taking such a risk and having bad luck: countless trillions of human deaths.
		We only die because our parents create us.
		I would be at least partly responsible for the death of my children, my grandchildren, my great grandchildren, et cetera.
		A one in two thousand chance of potentially causing such a massive eventual death count?
		Maybe I&apos;d be happier.
		But the potential consequences of the risk far outweighs whatever temporary happiness I may or may not derive from taking such chance.
		These are human lives I&apos;d be toying with.
	<p>
		I did get to learn more about vasectomies though.
		Before the surgeon would give me a simple yes or now answer to if there was a non-zero chance I&apos;d still accidentally create children, they wanted to go over how it&apos;s done, what to expect after the fact, and how to prepare for the operation.
		Honestly, I&apos;m thankful for the information, though it would have been nice if they&apos;d simply answered my question first.
		Still, as they went on, I did curiously ask questions to figure out how it would go down, and it honestly did sound very effective.
		It seems the attack on my fertility would be three-fold.
		First of all, the vas deferens are sheathed in an outer layer of sorts.
		Males have double-layer tubes down there.
		Once one of the tubes is pulled out from the scrotum, the outer layer is sliced to reach the inner tube, and a segment of the inner tube is removed.
		For the sperm to make it through effectively, the inner tube would need to grow back together.
		That said, it seems like cutting a segment out of the outer tube too would help, as then the inner tube isn&apos;t held into the perfect place to grow back together.
		Maybe I should have asked about that too.
		Next, one end of the cut tube is cauterised.
		Good luck healing a cauterised wound.
		However, the other end isn&apos;t.
		Again, I should have asked why not.
		And finally, part of the outer tube is clamped into a position that physically sits in the way, blocking the two tube segments from coming back together.
		Honestly, that sounds pretty effective to me.
		Still, it&apos;s only interesting in an academic sort of way, as a non-zero risk of mass death is still a non-zero chance of mass death.
	</p>
	<p>
		With the information I need in hand, my course is set.
		Lamenting over the information I&apos;ve gotten would be like being handed a map and lamenting that there&apos;s a river in the way of where you were considering going.
		The river is there, with or without the map.
		With the map, you now know how to either reach a bridge or avoid the river entirely.
	</p>
</section>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<p>
			I&apos;m not sure what is meant by the question when it asks &quot;the kind of tree structure&quot; is being used.
			Do you mean how the tree is implemented?
			If so, it&apos;s a node-based tree, not an array-based tree.
			Node objects are instantiated and added to the tree as new integers become known to belong in the structure.
			This tree is also sorted.
			Nodes with smaller integers are shuffled to the left, while nodes with higher integers are shuffled to the left.
			Each node figures out which subtree to send nodes to, then sends has the child (if any) representing that subtree deal with it.
			In that way, the tree&apos;s logic is recursive.
			The base case is that there&apos;s no child, in which case the new node becomes the child.
		</p>
		<p>
			The traversal performed on the tree is an in-order traversal.
			When the traversal is performed, you see the integers printed from low to high, because the tree keeps values sorted.
			From this, we see that the left subtree gets processed, then the node itself, then the right subtree.
		</p>
		<p>
			I&apos;m not sure I&apos;m evaluating this correctly, but it seems like traversal of the tree should take Θ(n) time.
			For all cases, the recursive process has to process n nodes and 2n pointers.
			We could measure the amount of time needed to push and pop the calling stack, but I&apos;m guessing this time is less than the time used to process a given node, and the book says we should ignore the lesser term.
			This means we ignore the depth of the tree.
			As for insertions, they take O(n<sup>2</sup>) in the worst case for the insertions.
			In theory, it&apos;d be a little over O(n<sup>2</sup>/2), but again, we ignore the division by two because it&apos;s a lesser term.
			The reason insertion costs are high in the worst case is that the insertions is that the integers may be inserted in order.
			If that were to happen, the nodes would end up in one long chain instead of a tree shape.
			Every new node would then need to be processed by every node that&apos;d come before it.
		</p>
		<p>
			For insertion in the best case, integers would be inserted in an order that keeps the tree perfectly balanced.
			I believe in this case, the insertion would take O(log<sub>2</sub>(n)).
			Again, I&apos;m not quite sure I analysed that correctly.
		</p>
	</blockquote>
</section>
END
);
